<script setup lang="ts">
// 获取屏幕边界到安全区域的距离
const { safeAreaInsets } = uni.getSystemInfoSync()
</script>

<template>
  <view class="navbar" :style="{ paddingTop: safeAreaInsets?.top + 'px' }">
    <!-- logo文字 -->
    <view class="logo">
      <text class="logo-title">三美旅行</text>
      <text class="logo-text">优质 · 亲民 · 快捷</text>
    </view>
    <view class="bar2">
      <!-- 位置 -->
      <view class="region">
        <text class="hx-font hx-region">苏州</text>
      </view>
      <!-- 搜索条 -->
      <navigator class="search" url="/pages/search/search" open-type="navigate">
        <text class="hx-font hx-search">搜索产品</text>
      </navigator>
    </view>
  </view>
</template>

<style lang="scss">
/* 自定义导航条 */
.navbar {
  background-image: url($img-url + 'navigator_bg.png');
  background-size: cover;
  position: relative;
  display: flex;
  flex-direction: column;
  padding-top: 20px;

  .logo {
    display: flex;
    align-items: center;
    height: 32px;
    padding-left: 15px;
    padding-top: 10px;
    color: #fff;

    .logo-title {
      line-height: $fs-md;
      font-size: $fs-md;
      font-weight: bold;
    }

    .logo-text {
      flex: 1;
      line-height: $fs-md;
      margin: 1px 0 0 10px;
      padding-left: 10px;
      border-left: 1px solid #fff;
      font-size: $fs-md;
    }
  }

  .bar2 {
    display: flex;
    justify-content: flex-start;
    align-items: center;
  }

  .region,
  .search {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 12px 4px 8px;
    margin: 8px;
    color: #fff;
    border-radius: 16px;
    background-color: rgba(255, 255, 255, 0.5);
  }

  .search {
    width: 300rpx;
  }

  .hx-font {
    font-size: $fs-md;
    &::before {
      margin: 0 5px 0 0;
    }
  }
}
</style>
